package corej.course.thread;

public class Machine extends Thread {
    public void run() {
        for (int a = 0; a < 50; a++) {
            System.out.println(currentThread().getName() + ":" + a);
            try {
                sleep(1000);
            } catch (InterruptedException e) {
                throw new RuntimeException(e);
            }
        }
    }

    public static void main(String args[]) {
        Machine machine1 = new Machine();
        Machine machine2 = new Machine();
        machine1.start();
        machine2.start();
        //machine1.run();
    }
}
